package com.cloudcc.mobile.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.cloudcc.mobile.R;

import java.util.List;

/**
 * Created by zys on 2017/6/2.
 */

public class NewContactListAdapter extends BaseAdapter{
    private List<String> list;
    private LayoutInflater mInflater;
    public NewContactListAdapter (List<String> listdata, Context context){
        this.list = listdata;
        this.mInflater = LayoutInflater.from(context);
    }
    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder viewHoder = null;
        if(convertView==null){
            viewHoder = new ViewHolder();
            convertView = mInflater.inflate(R.layout.newcontact_item, null);
            viewHoder.name = (TextView) convertView.findViewById(R.id.newcontact_item_name);
            viewHoder.juese = (TextView) convertView.findViewById(R.id.newcontact_itemjuese11);
            viewHoder.zhiwu = (TextView) convertView.findViewById(R.id.newcontact_item_zhiwu);
            viewHoder.phone = (TextView) convertView.findViewById(R.id.newcontact_item_phone);
            viewHoder.imageView = (ImageView) convertView.findViewById(R.id.newcontact_item_name_image);
            convertView.setTag(viewHoder);
        }else {
            viewHoder = (ViewHolder)convertView.getTag();
        }

        return convertView;
    }
    class ViewHolder {
        private TextView name,juese,zhiwu,phone;
        private LinearLayout linearLayout;
        private ImageView imageView;

    }
}
